package com.ymk.service.impl;

import com.ymk.base.mybatis.DaoRouter;
import com.ymk.base.mybatis.Pagination;
import com.ymk.bo.work.WorkBO;
import com.ymk.service.IWorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 莫参商
 * @since 2023-06-09
 */
@Service
public class WorkServiceImpl implements IWorkService {

    @Override
    public WorkBO get(Map param) {
    return this.daoRouter.queryForObject("Work.loadWork",param);
    }

    @Override
    public List<WorkBO> list(Map param) {
        return this.daoRouter.query("Work.loadWork",param);
    }

    @Override
    public List<WorkBO> listForWorkId(Map param) {
        return this.daoRouter.query("Work.listForWorkId",param);
    }

    @Override
    public List<WorkBO> listForPage(Map param) {
        return this.daoRouter.query("Work.loadWorkForPage", param);
    }

    @Override
    public List<WorkBO> listWorkIdForPage(Pagination pagination) {
        return this.daoRouter.query("Work.loadWorkIdForPage",pagination);
    }

    @Override
    public void post(WorkBO param) {
        this.daoRouter.insert("AWork.insertWork",param);
    }

    @Override
    public void update(WorkBO param) {
        this.daoRouter.update("AWork.updateWork",param);
    }

    @Override
    public void del(WorkBO param) {
        this.daoRouter.update("AWork.delWork",param);
    }

    @Autowired
    private DaoRouter daoRouter;

}
